#pragma once
#include "World.h"
#include "Runtime/Engine/Viewport.h"

namespace Alice
{
    class World;
    /** Public interface to FEngineLoop so we can call it from editor or editor code */
    class IEngineLoop
    {
    public:

        virtual int32 Init() = 0;

        virtual void Tick() = 0;

        /** Removes references to any objects pending cleanup by deleting them. */
        virtual void ClearPendingCleanupObjects() = 0;
    };
    class GameInstance;
    struct WorldContext
    {
        EWorldType::Type mWorldType;
        GameInstance*mGameInstance;
        World*mWorld;
        GameViewportClient*mGameViewportClient;
    };
    class Engine
    {
    public:
        IEngineLoop* mEngineLoop;
        std::unordered_set<WorldContext*> mWorldList;
        GameViewportClient*mGameViewportClient;
        virtual void Init(IEngineLoop*inEngineLoop);
        virtual void Tick(float inDeltaTime){}
        WorldContext* CreateNewWorldContext(EWorldType::Type WorldType);
        WorldContext* GetWorldContextFromWorld(const World* InWorld);
    };
}
extern Alice::Engine* gEngine;